package com.xique.door.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xique.door.bean.domain.PermissionGroupDevice;
import com.xique.door.bean.request.permissionGroup.PermissionGroupDeviceRequest;
import com.xique.door.bean.search.PermissionGroupDeviceListSearch;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 权限组设备Mapper接口
 *
 * @author ww
 * @date 2021-06-17
 */
@Repository
public interface PermissionGroupDeviceMapper extends BaseMapper<PermissionGroupDevice> {
    /**
     * 查询权限组设备
     *
     * @param id 权限组设备ID
     * @return 权限组设备
     */
    public PermissionGroupDevice selectPermissionGroupDeviceById(Long id);

    /**
     * 查看权限组设备列表
     *
     * @param groupIds
     * @return
     */
    public List<PermissionGroupDevice> selectPermissionGroupDeviceListByGroupIds(@Param("groupIds") List<Long> groupIds);

    /**
     * 获取权限组设备列表
     *
     * @param deviceIds 设备IDS
     * @return java.util.List<com.jzy.oms.access.permissionGroup.device.bean.domain.PermissionGroupDevice>
     * @author shd
     * @date 2021/7/6 11:36
     */
    List<PermissionGroupDevice> selectPermissionGroupDeviceListByDeviceIds(@Param("deviceIds") List<Long> deviceIds);


    /**
     * 查询权限组设备列表
     *
     * @param permissionGroupDevice 权限组设备
     * @return 权限组设备集合
     */
    public List<PermissionGroupDevice> selectPermissionGroupDeviceList(PermissionGroupDevice permissionGroupDevice);

    /**
     * 新增权限组设备
     *
     * @param permissionGroupDevice 权限组设备
     * @return 结果
     */
    public int insertPermissionGroupDevice(PermissionGroupDevice permissionGroupDevice);

    /**
     * 批量插入权限组设备信息
     *
     * @param list
     * @return int
     * @author shd
     * @date 2021/7/6 10:15
     */
    int batchInsertPermissionGroupDevice(List<PermissionGroupDevice> list);

    /**
     * 修改权限组设备
     *
     * @param permissionGroupDevice 权限组设备
     * @return 结果
     */
    public int updatePermissionGroupDevice(PermissionGroupDevice permissionGroupDevice);

    /**
     * 删除权限组设备
     *
     * @param id 权限组设备ID
     * @return 结果
     */
    public int deletePermissionGroupDeviceById(Long id);

    /**
     * 批量删除权限组设备
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    public int deletePermissionGroupDeviceByIds(@Param("ids") List<Long> ids);

    /**
     * 批量删除权限组设备
     *
     * @param groupId 需要删除的数据ID
     * @return 结果
     */
    public int deletePermissionGroupDeviceByGroupId(Long groupId);

    /**
     * 获取权限组设备信息
     * @author shd
     * @date 2021/7/7 16:26
     * @param search
     * @return java.util.List<com.jzy.oms.access.permissionGroup.device.bean.domain.PermissionGroupDevice>
     */
    List<PermissionGroupDevice> selectPermissionGroupDeviceListBySearch(PermissionGroupDeviceListSearch search);

    /**
     * 查询未添加的设备列表
     * @author shd
     * @date 2021/7/8 14:21
     * @param request
     * @return com.ruoyi.common.core.domain.AjaxResult
     */
    List<PermissionGroupDevice> selectUnallocatedList(PermissionGroupDeviceRequest request);

    /**
     * 查询已添加的设备列表
     * @author shd
     * @date 2021/7/8 14:21
     * @param request
     * @return com.ruoyi.common.core.domain.AjaxResult
     */
    List<PermissionGroupDevice> selectAllocatedList(PermissionGroupDeviceRequest request);
}
